<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="test"></div>

  <!-- 引入react核心库，这个库必须最先引入 -->
  <script src="./js/react.development.js"></script>
  <!-- 引入react-dom，用于支持react操作dom -->
  <script src="./js/react-dom.development.js"></script>
  <!-- 引入babel，将jsx转化为js -->
  <script src="./js/babel.min.js"></script>

  <script type="text/babel">
    // 类式组件编程
    class Demo extends React.Component {
      render() {
        console.log('render中的this', this) //this是Demo组件实例对象
        return <h2>类式组件编程</h2>
      }
    }

    // 注意组件名称必须大写
    ReactDOM.render(<Demo />, document.getElementById('test'))
  </script>
</body>

</html>